
services:

  # PHP Service
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: php:8.3
    container_name: app
    restart: unless-stopped
    tty: true
    environment:
      SERVICE_NAME: app
      SERVICE_TAGS: dev
    working_dir: /var/www
    volumes:
      - .:/var/www
    networks:
      - app-network

  # Nginx Service
  node:
    build:
      context: .
      dockerfile: node/Dockerfile
    container_name: node
    volumes:
      - .:/var/www

  webserver:
    image: nginx:latest
    container_name: webserver
    restart: unless-stopped
    tty: true
    ports:
      - "81:80"
      - "444:443"
    volumes:
      - .:/var/www/
      - ./nginx/conf.d:/etc/nginx/conf.d
    networks:
      - app-network

  # MySQL Service
  db:
    image: postgres:13.0
    restart: always
    ports:
      - 5433:5432
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
    volumes:
      - db:/var/lib/postgresql/data
    networks:
      - app-network

# Docker Networks
networks:
  app-network:
    driver: bridge

volumes:
  db:
